package com.sec.android.app.myfiles.module.local.blank;

import android.content.Context;
import android.view.ContextMenu;
import android.view.Menu;
import android.view.MenuItem;

import com.sec.android.app.myfiles.R;
import com.sec.android.app.myfiles.fragment.AbsMyFilesFragment;
import com.sec.android.app.myfiles.info.AppFeatures;
import com.sec.android.app.myfiles.module.abstraction.FileRecord;
import com.sec.android.app.myfiles.module.local.home.HomeMenuImp;
import com.sec.android.app.myfiles.navigation.NavigationManager;
import com.sec.android.app.myfiles.util.PreferenceUtils;
import com.sec.android.app.myfiles.util.UiUtils;

import java.util.ArrayList;

/**
 * Created by n.chaubey on 13-07-2017.
 */
public class BlankMenuImp extends HomeMenuImp {

    public BlankMenuImp(Context context, FileRecord.StorageType supportStorage) {
        super(context, supportStorage);
    }

    @Override
    public void onPrepareNormalOptionsMenu(Menu menu) {
        super.onPrepareNormalOptionsMenu(menu);
        setMenuItemVisibility(menu, R.id.menu_edit, false);
        setMenuItemVisibility(menu, R.id.menu_share, false);
        setMenuItemVisibility(menu, R.id.menu_clear_recent_history, false);
        setMenuItemVisibility(menu, R.id.menu_contact_us, isMyFilesHome() && UiUtils.checkSamsungMembersApp(mContext));
        setMenuItemVisibility(menu, R.id.menu_optimize_storage, UiUtils.supportOptimizeStorage(mContext) && isMyFilesHome());
        setMenuItemVisibility(menu, R.id.menu_toggle_list_type, true);
        setMenuItemEnabled(menu, R.id.menu_toggle_list_type, false);
        setMenuItemIcon(menu.findItem(R.id.menu_toggle_list_type));
        setMenuItemVisibility(menu, R.id.menu_search, true);
        setMenuItemVisibility(menu, R.id.menu_manage_shortcut, (AppFeatures.isTabletUIMode() || AppFeatures.isNote()) && isMyFilesHome() && NavigationManager.isPossibleToActionMode() && PreferenceUtils.getMyFilesShortcutCount(mContext) > 0);
    }

    @Override
    public void onPrepareEditOptionsMenu(Menu menu) {

    }

    @Override
    public boolean _onOptionsItemSelected(MenuItem item) {
        return super._onOptionsItemSelected(item);
    }

    @Override
    protected void createContextualMenuOnBackground(ContextMenu menu) {

    }

    @Override
    protected void createContextualMenuOnLeftPanel(ContextMenu menu, FileRecord record) {

    }

    @Override
    protected void _createContextualMenuOnItems(ContextMenu menu, FileRecord record, boolean isForOneItem) {

    }

    @Override
    public boolean _onContextualItemSelected(MenuItem item, ArrayList<FileRecord> srcRecordList, FileRecord record, AbsMyFilesFragment fragment) {
        return false;
    }
}
